package com.business.system.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.business.system.mapper.ClientMapper;
import com.business.system.service.IClientService;

import com.common.entity.Client;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;


/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author pgx
 * @since 2022-09-05
 */
@Service
public class ClientServiceImpl implements IClientService{
    @Autowired
    private ClientMapper clientMapper;
    @Override
    public Client findClientByUsername(String mobile) {
        QueryWrapper<Client> queryWrapper = new QueryWrapper();
        queryWrapper.eq("mobile",mobile);
        Client client = clientMapper.selectOne(queryWrapper);
        return client;
    }

    @Override
    public List<Map> findAllClientNameAndId() {
       List<Map> list = clientMapper.findAllClientNameAndId();
        return list;
    }
}
